Due to the recent rapid development of electronic devices such as mobile devices and smartphones, electronic devices which can perform wireless voice calls and exchange information such as Internet data have become daily necessities for a large number of users. With the development of technology and introduction of wireless Internet, these electronic devices have gradually broadened its features to a wide variety of applications including games, calendar, still image and video recording, etc., in addition to wireless voice calls.
Generally, earphones are provided as an accessory of the electronic device to output audio when, for example, the user is using an audio or video playback application of the electronic device. Earphones may also sometimes come equipped with a microphone, so that the earphones are capable of outputting a counterparty's voice audio data as well as inputting the user's voice audio data when the user is using the electronic device to make a wireless voice call with the counterparty.
When the earphones are inserted into the electronic device, the electronic device may identify the type of the inserted earphones and set an appropriate sound path for the identified earphones.
For example, the electronic device may detect whether the inserted earphones are microphone type earphones or non-microphone type earphone. When the inserted earphones are detected as the microphone type earphones, the electronic device may determine the sound input device as the microphone of the earphones and determine the sound output device as the speaker of the earphones. An appropriate sound path may be set by the electronic device to output sound to the speaker of the earphones and input sound from the microphone of the earphones. In another example, when the inserted earphones are detected as the non-microphone type earphones, the electronic device may determine the sound input device as the microphone included in the electronic device and determine the sound output device as the speaker of the earphones. An alternative sound path may be set by the electronic device to output sound to the speaker of the earphones and input sound from the microphone included in the electronic device.